// 存储数据
const state = {
	userInfo:uni.getStorageSync('userInfo')||'',
	cityName:uni.getStorageSync('cityName')||''
}

// 修改数据方法
const mutations = {
	setUserInfo(state, value) {
		state.userInfo = value
		uni.setStorageSync('userInfo',state.userInfo)
	},
	setCityName(state,value){
		state.cityName=value
		uni.setStorageSync('cityName',state.cityName)
	}
}

// 异步修改数据
const actions = {
	// acFn(ctx, value) {
	// 	ctx.commit('setUserInfo', value)
	// }
}

export default {
	// 开启命名空间
	namespaced: true,
	state,
	mutations,
	actions
}

// import {
// 		mapState,
// 		mapMutations,
// 		mapActions
// 	} from "vuex"

// computed: {
// 	...mapState('user', ['xxx'])
// },

// ...mapMutations('user', ['fn']),
// 	...mapActions('user', ['acFn']),
